ArrayList<PVector> points = new ArrayList<PVector>();

void setup()
{
  size(1000, 800, OPENGL);
  smooth();
  //createPerfectSphere(250);
  createRandomSphere(250, 4000);
}

void createPerfectSphere(float radius)
{
  for(float phi = 0; phi < PI; phi += .2)
  {
    for(float theta = 0; theta < 2 * PI; theta += .2)
    {  
      float x = 0 + radius * cos(theta) * sin(phi);
      float y = 0 + radius * sin(theta) * sin(phi);
      float z = 0 + radius * cos(phi);
      points.add(new PVector(x, y, z));      
    }
  }
}

void createRandomSphere(float radius, int numPoints)
{
  for(int i = 0; i < numPoints; i++)
  {    
    float phi = random(0, PI);
    float theta = random(0, 2 * PI);     
    float x = 0 + radius * cos(theta) * sin(phi);
    float y = 0 + radius * sin(theta) * sin(phi);
    float z = 0 + radius * cos(phi);
    points.add(new PVector(x, y, z));          
  }
}
void draw()
{
  background(0);
  translate(width/2, height/2);
  rotateX(radians(frameCount));
  rotateY(radians(frameCount));
  rotateZ(radians(frameCount));
  for(PVector p : points)
  {
    stroke(frameCount%255, 200, 244, 10);
    strokeWeight(16);
    point(p.x, p.y, p.z);
    stroke(45, frameCount%255, 244, 50);
    strokeWeight(9);
    point(p.x, p.y, p.z);
    stroke(45, 200, frameCount%255, 100);
    strokeWeight(3);
    point(p.x, p.y, p.z);    
  }
}
